abstract class SecureStore {
  Future<void> write(String key, String value);

  Future<String?> read(String key);

  Future<void> delete(String key);
}

/// 默认简单的内存实现
class MemoryStore implements SecureStore {
  final Map<String, String> _m = {};

  @override
  Future<void> write(String key, String value) async => _m[key] = value;

  @override
  Future<String?> read(String key) async => _m[key];

  @override
  Future<void> delete(String key) async => _m.remove(key);
}
